package com.ruoyi.yljf.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.yljf.mapper.BalanceDetailMapper;
import com.ruoyi.yljf.domain.BalanceDetail;
import com.ruoyi.yljf.service.IBalanceDetailService;

import javax.annotation.Resource;

/**
 * 余额明细Service业务层处理
 * 
 * @author metaee
 * @date 2025-03-20
 */
@Service
public class BalanceDetailServiceImpl extends ServiceImpl<BalanceDetailMapper, BalanceDetail> implements IBalanceDetailService {
    @Resource
    private BalanceDetailMapper balanceDetailMapper;
    
    /**
     * 查询余额明细列表
     * 
     * @param balanceDetail 余额明细
     * @return 余额明细
     */
    @Override
    public List<BalanceDetail> selectBalanceDetailList(BalanceDetail balanceDetail) {
    	LambdaQueryWrapper<BalanceDetail> queryWrapper = Wrappers.lambdaQuery();
        if (StringUtils.isNotNull(balanceDetail.getUserId())) {
			queryWrapper.eq(BalanceDetail::getUserId, balanceDetail.getUserId());
		}
        if (StringUtils.isNotEmpty(balanceDetail.getDescribe())) {
			queryWrapper.eq(BalanceDetail::getDescribe, balanceDetail.getDescribe());
		}
        if (StringUtils.isNotNull(balanceDetail.getCreatTime())) {
			queryWrapper.eq(BalanceDetail::getCreatTime, balanceDetail.getCreatTime());
		}
        if (StringUtils.isNotEmpty(balanceDetail.getDetail())) {
			queryWrapper.eq(BalanceDetail::getDetail, balanceDetail.getDetail());
		}
        return balanceDetailMapper.selectList(queryWrapper);
    }
}
